-
Notifications
You must be signed in to change notification settings - Fork 123
bugfix: Flex & Repeater fields not previewable #205
bugfix: Flex & Repeater fields not previewable #205
Conversation
Release/v0.3.4
Release/v0.3.5
Release/v0.4.0
…of the revision parent to include subfields of flex/repeaters. This allows flex/repeater fields to be previewed using the revised data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and makes sense to me 👍
are you doing the tests as part of this PR or a separate one?
@TylerBarnes I was going to follow up with some tests later. They're a bit cumbersome to write for this case so I wanted to ship this to unblock folks first. |
I applied this fix, but it didn't solve the issue. For what it's worth, the fix in #159 does solves my issue. Let me know if you need any other info or help testing. |
@tobiasandersen can you share screenshots of your Post Edit screen with the data you're inputting, then show me screenshots of GraphiQL where you're querying the Published Post, and the Preview Post so I can see the difference. If we make the change suggested in #159 it would break all other non-ACF meta, and this would be bad. It also wouldn't fix the issue of being able to preview ACF revisions. I'd be happy to even hop on a Zoom or other video call to see what you're experiencing and see if we can get to the bottom of this. |
Just tested this out and it seems to work well for me 👍 maybe this solves some of the problems but not all? If that's the case I vote we merge/ship this and then circle back on additional improvements (unless those other fixes can be made soon) |
@tobiasandersen an export of your acf fields could be useful here too |
I'm not sure what I did wrong last time, but when I was gonna reproduce it again now to show you, I wasn't able to. Sorry for the false alarm, this seems to fix my issues as well! Thanks @jasonbahl 🙏 |
@jasonbahl as I've written in the #292, I still get null when using |
ACF stores revisions to fields in the meta of the revision. WPGraphQL attempts to resolve meta from the parent (published) post as WordPress core doesn't store revisions for meta. ACF does store revisions for ACF fields, so the WPGraphQL for ACF plugin currently is set to resolve ACF fields on revisions using the meta of the revision post.
There's currently a bug with nested fields of repeater and flex fields not properly resolving for revisions. This addresses that.
Before
Querying a Flex and Repeater field shows the same values for both the published post and the preview post:
After
Querying a Flex and Repeater field shows the published values for the published post, and the preview values for the preview post: